package com.lrs.java.j2se_self.net;
import java.io.*;
import java.net.*;

public class TestServer {
	public static void main(String[] args){
		try{
			ServerSocket ss = new ServerSocket(6666);
			while(true){
				Socket s = ss.accept();
				DataOutputStream dos = new DataOutputStream(s.getOutputStream());
				dos.writeUTF(s.getInetAddress()+"IP"+s.getPort()+" port");
				//System.out.println("the outputStream is ready!");
				dos.close();
				s.close();
			}
		}catch(IOException e){
			e.printStackTrace();
		}
		
	}
}
